package springboot.mybatis.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import springboot.mybatis.bean.Monster;
import springboot.mybatis.service.MonsterService;

import javax.annotation.Resource;

@Controller
public class MonsterController {
    @Resource
    private MonsterService monsterService;
    @GetMapping("/monster")
    @ResponseBody
    public Monster getMonsterById(@RequestParam("id") Integer id){
        return monsterService.getMonsterById(id);
    }
}
